home *** CD-ROM | disk | FTP | other *** search
/ AppleScript - The Beta Release / AppleScript - The Beta Release.iso / Development Tools / Sample Applications / CoreSample / CoreSample Source / CoreSample.r < prev    next >
Encoding:
Text File  |  1992-11-24  |  6.1 KB  |  283 lines  |  [TEXT/MPS ]

  1. //----------------------------------------------------------------------//
  2. //    CoreSample.r    -    Rez Source                                        //
  3. //                                                                        //
  4. //    CoreSample is an application that is Apple Event-aware, Scripting    //
  5. //    Compatible, and recordable.  It provides support for the Required    //
  6. //    and Core suite of Apple Events, the Object Model, and the Open        //
  7. //    Scripting Architecture.                                                //
  8. //                                                                        //
  9. //    by:    Sue Dumont                                                        //
  10. //        Applications Scripting Group                                    //
  11. //                                                                        //
  12. //    Copyright © Apple Computer, Inc. 1991,1992                            //
  13. //    All rights reserved.                                                //
  14. //----------------------------------------------------------------------//
  15.  
  16. #include "systypes.r"
  17. #include "types.r"
  18. #include "CoreSample.h"
  19.  
  20. resource 'vers' (1) {
  21.     0x01, 0x00, release, 0x00, verUS,
  22.     "1.01",
  23.     "1.01, Copyright \251 Apple Computer, Inc. 1991-1992"
  24. };
  25.  
  26. resource 'MBAR' (rMenuBar, preload) {
  27.     { mApple, mFile, mEdit };        /* three menus */
  28. };
  29.  
  30.  
  31. resource 'MENU' (mApple, preload) {
  32.     mApple, textMenuProc,
  33.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  34.     enabled, apple,
  35.     {
  36.         "About CoreSample\311",
  37.             noicon, nokey, nomark, plain;
  38.         "-",
  39.             noicon, nokey, nomark, plain
  40.     }
  41. };
  42.  
  43. resource 'MENU' (mFile, preload) {
  44.     mFile, textMenuProc,
  45.     0b0000000000000000000000010000000,        /* Enable Quit only, program enables others. */
  46.     enabled, "File",
  47.     {
  48.         "New",
  49.             noicon, "N", nomark, plain;
  50.         "Open",
  51.             noicon, "O", nomark, plain;
  52.         "-",
  53.             noicon, nokey, nomark, plain;
  54.         "Close",
  55.             noicon, "W", nomark, plain;
  56.         "Save",
  57.             noicon, "S", nomark, plain;
  58.         "Save As\311",
  59.             noicon, nokey, nomark, plain;
  60.         "-",
  61.             noicon, nokey, nomark, plain;
  62.         "Quit",
  63.             noicon, "Q", nomark, plain
  64.     }
  65. };
  66.  
  67. resource 'MENU' (mEdit, preload) {
  68.     mEdit, textMenuProc,
  69.     0b0000000000000000000000000000000,    /* disable everything, program does the enabling */
  70.     enabled, "Edit",
  71.      {
  72.         "Undo",
  73.             noicon, "Z", nomark, plain;
  74.         "-",
  75.             noicon, nokey, nomark, plain;
  76.         "Cut",
  77.             noicon, "X", nomark, plain;
  78.         "Copy",
  79.             noicon, "C", nomark, plain;
  80.         "Paste",
  81.             noicon, "V", nomark, plain;
  82.         "Clear",
  83.             noicon, nokey, nomark, plain
  84.     }
  85. };
  86.  
  87.  
  88. /* this ALRT and DITL are used as an About screen */
  89.  
  90. resource 'ALRT' (rAboutAlert, purgeable) {
  91.     {40, 20, 214, 296}, rAboutAlert, {
  92.         OK, visible, silent;
  93.         OK, visible, silent;
  94.         OK, visible, silent;
  95.         OK, visible, silent
  96.     };
  97. };
  98.  
  99. resource 'DITL' (rAboutAlert, purgeable) {
  100.     { /* array DITLarray: 7 elements */
  101.         /* [1] */
  102.         {148, 184, 168, 264},
  103.         Button {
  104.             enabled,
  105.             "OK"
  106.         },
  107.         /* [2] */
  108.         {8, 69, 24, 295},
  109.         StaticText {
  110.             disabled,
  111.             "CoreSample 1.01"
  112.         },
  113.         /* [3] */
  114.         {28, 40, 44, 295},
  115.         StaticText {
  116.             disabled,
  117.             "Recordable and Scriptable"
  118.         },
  119.  
  120.         /* [4] */
  121.         {50, 8, 66, 295},
  122.         StaticText {
  123.             disabled,
  124.             "Copyright \251 Apple Computer, 1991-92"
  125.         },
  126.         /* [5] */
  127.         {80, 8, 112, 136},
  128.         StaticText {
  129.             disabled,
  130.             "by:"
  131.         },
  132.         /* [6] */
  133.         {95, 69, 127, 167},
  134.         StaticText {
  135.             disabled,
  136.             "Sue Dumont"
  137.         },
  138.         /* [7] */
  139.         {111, 20, 140, 206},
  140.         StaticText {
  141.             disabled,
  142.             "Applications Scripting Group"
  143.         }
  144.     }
  145. };
  146.  
  147.  
  148. /* this ALRT and DITL are used as an error screen */
  149.  
  150. resource 'ALRT' (rUserAlert, purgeable) {
  151.     {40, 20, 150, 260},
  152.     rUserAlert,
  153.     { /* array: 4 elements */
  154.         /* [1] */
  155.         OK, visible, silent,
  156.         /* [2] */
  157.         OK, visible, silent,
  158.         /* [3] */
  159.         OK, visible, silent,
  160.         /* [4] */
  161.         OK, visible, silent
  162.     }
  163. };
  164.  
  165.  
  166. resource 'DITL' (rUserAlert, purgeable) {
  167.     { /* array DITLarray: 3 elements */
  168.         /* [1] */
  169.         {80, 150, 100, 230},
  170.         Button {
  171.             enabled,
  172.             "OK"
  173.         },
  174.         /* [2] */
  175.         {10, 60, 60, 230},
  176.         StaticText {
  177.             disabled,
  178.             "Error! ^0!"
  179.         },
  180.         /* [3] */
  181.         {8, 8, 40, 40},
  182.         Icon {
  183.             disabled,
  184.             2
  185.         }
  186.     }
  187. };
  188.  
  189. resource 'WIND' (rDocWindow, preload, purgeable) {
  190.     {64, 60, 250, 360},
  191.     zoomDocProc, invisible, goAway, 0x0, "Untitled"
  192. };
  193.  
  194. resource 'STR#' (kErrStrings, purgeable) {
  195.     {
  196.     "You must run on 512Ke or later";
  197.     "Application Memory Size is too small";
  198.     "Not enough memory to run CoreSample";
  199.     "Apple Event error has occured"
  200.     }
  201. };
  202.  
  203. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  204.  
  205. resource 'SIZE' (-1) {
  206.     dontSaveScreen,
  207.     acceptSuspendResumeEvents,
  208.     enableOptionSwitch,
  209.     canBackground,                /* we can background; we don't currently, but our sleep value */
  210.                                 /* guarantees we don't hog the Mac while we are in the background */
  211.     doesActivateOnFGSwitch,        /* this says we do our own activate/deactivate; don't fake us out */
  212.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  213.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  214.     ignoreAppDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  215.     is32BitCompatible,            /* this app should not be run in 32-bit address space */
  216.     isHighLevelEventAware,        /* set this flag to support Apple Events */
  217.     localAndRemoteHLEvents,        /* <aevt */
  218.     reserved,
  219.     reserved,
  220.     reserved,
  221.     reserved,
  222.     reserved,
  223.     kPrefSize * 1024,
  224.     kMinSize * 1024    
  225. };
  226.  
  227.  
  228.  
  229. type 'smpl' as 'STR ';
  230.  
  231.  
  232. resource 'smpl' (0) {
  233.     "Application that supports Apple Events and AppleScript"
  234. };
  235.  
  236.  
  237.  
  238. resource 'BNDL' (128) {
  239.     'smpl',
  240.     0,
  241.     {
  242.         'ICN#',
  243.         {
  244.         0, 128
  245.         },
  246.         'FREF',
  247.         {
  248.             0, 128
  249.         }
  250.     }
  251. };
  252.  
  253.  
  254. resource 'FREF' (128) {
  255.     'APPL',
  256.     0,
  257.     ""
  258. };
  259.  
  260. resource 'ICN#' (128) {
  261.     { /* array: 2 elements */
  262.         /* [1] */
  263.         $"04 30 40 00 0A 50 A0 00 0B 91 10 02 08 22 08 03"
  264.         $"12 24 04 05 20 28 02 09 40 10 01 11 80 0C 00 A1"
  265.         $"80 03 FF C2 7E 00 FF 04 01 00 7F 04 03 00 1E 08"
  266.         $"04 E0 00 0C 08 E0 00 0A 10 E0 00 09 08 C0 00 06"
  267.         $"04 87 FE 04 02 88 01 04 01 88 00 84 00 88 00 44"
  268.         $"00 88 00 44 00 88 00 C4 01 10 01 88 02 28 03 10"
  269.         $"01 C4 04 E0 00 02 08 00 73 BF FB EE 4C A2 8A 2A"
  270.         $"40 AA AA EA 52 AA AA 24 5E A2 8A EA 73 BE FB 8E",
  271.         /* [2] */
  272.         $"04 30 40 00 0E 70 E0 00 0F F1 F0 02 0F E3 F8 03"
  273.         $"1F E7 FC 07 3F EF FE 0F 7F FF FF 1F FF FF FF BF"
  274.         $"FF FF FF FE 7F FF FF FC 01 FF FF FC 03 FF FF F8"
  275.         $"07 FF FF FC 0F FF FF FE 1F FF FF FF 0F FF FF FE"
  276.         $"07 FF FF FC 03 FF FF FC 01 FF FF FC 00 FF FF FC"
  277.         $"00 FF FF FC 00 FF FF FC 01 FF FF F8 03 EF FF F0"
  278.         $"01 C7 FC E0 00 03 F8 00 73 BF FB EE 7F BE FB EE"
  279.         $"7F BE FB EE 7F BE FB E4 7F BE FB EE 73 BE FB 8E"
  280.     }
  281. };
  282.  
  283.